﻿namespace EyeOpen.DataGridViewIntercept.Windows
{
	using System.Collections.Generic;
	using System.Windows.Forms;

	public partial class MainForm 
		: Form
	{
		public MainForm()
		{
			InitializeComponent();

			dataGridView1.DataSource = 
				new List<Customer>
					{
						new Customer { Value = 10.3M }, 
						new Customer { Value = 3.5M }
					};
		}

		private void DataGridView1EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
		{
			e.Control.KeyPress += 
				(s, a) =>
					{
						if (a.KeyChar == '.')
						{
							a.KeyChar = ',';
						}
					};
		}
	}
}